Skip to main content

XPDFViewer_GetSelectionImage

Type

command

Summary

This command sets the value of a named variable to the imageData of the current image selection.

Syntax

XPDFViewer_GetSelectionImage <viewerName>, <variableName>

Description

The selection is rendered at the current viewer scale. LiveCode imageData does not contain any width or height information so you must set the width and height of the image correctly before setting the imageData. The command returns the size (width, height) of the image. As the image is drawn at the current scale of the PDF view the width/height returned will not match the width/height calculated from XPDFViewer_GetImageSelectionRect on Mac retina and high DPI windows systems.

The following errors may be thrown by the command:

  • XPDF_ERROR: incorrect number of parameters
  • XPDF_ERROR: PDF viewer not found

Parameters

NameTypeDescription

viewerName

string

The name of the viewer.

Examples

local tImageData
XPDFViewer_GetSelectionImage "Document1", "tImageData"
put the result into tSize
set the width of image "selection" to item 1 of tSize
set the height of image "selection" to item 2 of tSize
set the imageData of image "selection" to tImageData

Compatibility and Support

Introduced

LiveCode 1.0.0

OS

mac

windows

Platforms

desktop

Thank you for your feedback!

Was this page helpful?